![]() |
PATH![]() |
![]() ![]() |
The Arbitrary Element reference form specifies an arbitrary object in a container. If the container is a value (such as a list), AppleScript chooses an object at random (that is, it uses a random-number generator to choose the object). If the container is an application object, it is up to the application to choose an object. It can choose a random object or any object at all. This form is rarely used.
The following examples return a random file from a disk and a random word from a document. Because an arbitrary element is, by its nature, random, this form is rarely useful in processing groups of files, words, or other objects.
tell application "Finder"
some file of startup disk
end tell
tell application "AppleWorks"
some word of text body of front document
end tell